@echo off

rem Required:
rem  * ctypeslib
rem  * an unofficial gccxml release
rem      http://web.archive.org/web/20090131061101/http://sourceforge.net/project/showfiles.php?group_id=71702&package_id=146740
rem      http://sourceforge.net/projects/ctypes/files/gccxml/2008-08-12/gccxml-0.9.0-win32-x86.exe/download
rem  * Visual C++ 2008 Express Edition
rem      http://download.microsoft.com/download/4/A/B/4AB57BD2-DD80-4767-9B06-FFD2909CFF11/vcsetup.exe

set PYTHON_HOME=C:\Python26
set VS_HOME=C:\Program Files\Microsoft Visual Studio 9.0
set SDK_HOME=C:\Program Files\Microsoft SDKs\Windows\v6.0A
set GCCXML_COMPILER=msvc9

call "%VS_HOME%\VC\vcvarsall.bat"

set OLD_PATH=%CD%
cd winfiles

"%PYTHON_HOME%\python.exe" "%PYTHON_HOME%\Scripts\h2xml.py" "%CD%\faad.h" -o ..\xmls\faad_win.xml -q -c
"%PYTHON_HOME%\python.exe" "%PYTHON_HOME%\Scripts\xml2py.py" ..\xmls\faad_win.xml -o ..\pyfaad\faad\faad_win.py -l libfaad2.dll

set SYMBOLS=
set SYMBOLS=%SYMBOLS% -s MM_WOM_OPEN
set SYMBOLS=%SYMBOLS% -s MM_WOM_CLOSE
set SYMBOLS=%SYMBOLS% -s MM_WOM_DONE
set SYMBOLS=%SYMBOLS% -s HWAVEOUT
set SYMBOLS=%SYMBOLS% -s WAVE_FORMAT_PCM
set SYMBOLS=%SYMBOLS% -s WAVE_MAPPER
set SYMBOLS=%SYMBOLS% -s LPVOID
set SYMBOLS=%SYMBOLS% -s CALLBACK_NULL
set SYMBOLS=%SYMBOLS% -s CALLBACK_FUNCTION
set SYMBOLS=%SYMBOLS% -s MMSYSERR_NOERROR
set SYMBOLS=%SYMBOLS% -s WAVEFORMATEX
set SYMBOLS=%SYMBOLS% -s WAVERR_BASE
set SYMBOLS=%SYMBOLS% -s WAVERR_STILLPLAYING
set SYMBOLS=%SYMBOLS% -s WAVEHDR
set SYMBOLS=%SYMBOLS% -s waveOutOpen
set SYMBOLS=%SYMBOLS% -s waveOutPrepareHeader
set SYMBOLS=%SYMBOLS% -s waveOutWrite
set SYMBOLS=%SYMBOLS% -s waveOutUnprepareHeader
set SYMBOLS=%SYMBOLS% -s waveOutClose

"%PYTHON_HOME%\python.exe" "%PYTHON_HOME%\Scripts\h2xml.py" "%SDK_HOME%\Include\Windows.h" "%SDK_HOME%\Include\MMSystem.h" -o ..\xmls\MMSystem_h.xml -q -c
"%PYTHON_HOME%\python.exe" "%PYTHON_HOME%\Scripts\xml2py.py" %SYMBOLS% ..\xmls\MMSystem_h.xml -o ..\pyfaad\pcmplayer\MMSystem.py -l winmm.dll

cd %OLD_PATH%
set OLD_PATH=
